@echo off
echo start build...
set ANDROID_SDK=F:/AndroidSDK
@REM set ANDROID_SDK=C:/Dev/Android/Sdk
@REM set ANDROID_SDK=D:\Android\SDK
set ANDROID_NDK=%ANDROID_SDK%/ndk/21.4.7075529
set CMAKE_TOOLCHAIN_FILE=%ANDROID_NDK%/build/cmake/android.toolchain.cmake
set MAKE_MAKE_PROGRAM=%ANDROID_SDK%/cmake/3.18.1/bin/ninja.exe
set WIN_VS_VER= "Visual Studio 16 2019"
@REM set WIN_VS_VER= "Visual Studio 2022"

set workingDir=%~dp0
echo %workingDir%
cd %workingDir%

@REM android
for %%a in (apollomcu freetype-VER-2-13-3 libtiff-4.6.0 sqlite-3.44.2 spdlog-2.x proj-9.3.1 points2grid tinyxml2 libjpeg-turbo-3.0.1 SQLiteCpp mbedtls-3.6.5 ) do (
	echo %%a
    copy build_android_shared.bat %workingDir%\%%a
    cd %%a
    call build_android_shared.bat %ANDROID_NDK% %CMAKE_TOOLCHAIN_FILE% %MAKE_MAKE_PROGRAM%
    del build_android_shared.bat
    cd ..
)

@REM windows
@REM for %%a in (freetype-VER-2-13-3 libtiff-4.6.0 sqlite-3.44.2 spdlog-2.x proj-9.3.1 points2grid tinyxml2 libjpeg-turbo-3.0.1 OpenSceneGraph-3.6.5) do (
@REM 	echo %%a
@REM     copy build_win_d.bat %workingDir%\%%a
@REM     cd %%a
@REM     call build_win_d.bat %WIN_VS_VER%
@REM     del build_win_d.bat
@REM     cd ..
@REM )

@REM osg android
@REM copy build_android_osg_shared.bat %workingDir%\OpenSceneGraph-3.6.5
@REM cd OpenSceneGraph-3.6.5
@REM call build_android_osg_shared.bat %ANDROID_NDK% %CMAKE_TOOLCHAIN_FILE% %MAKE_MAKE_PROGRAM%
@REM del build_android_osg_shared.bat
@REM cd ..